﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Modules_IA_record : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList2.Text == "按操作区域查看")
        {
            Label1.Visible = true;
            Label3.Visible = false;
            DropDownList1.Visible = true;
            DropDownList3.Visible = false;
        }
        else if (DropDownList2.Text == "按控制端查看")
        {
            Label1.Visible = false;
            Label3.Visible = true;
            DropDownList1.Visible = false;
            DropDownList3.Visible = true;
        }
        else if (DropDownList2.Text == "查看所有操作")
        {
            Label1.Visible = false;
            Label3.Visible = false;
            DropDownList1.Visible = false;
            DropDownList3.Visible = false;
            GridView1.DataSourceID = "SqlDataSource5";
        }
    }

    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridView1.DataSourceID = "SqlDataSource1";
    }

    protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
    {
        GridView1.DataSourceID = "SqlDataSource4";
    }
    //时间戳
    //public static DateTime GetTime(string now)
    //{
    //    string timeStamp = now;
    //    DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
    //    long lTime = long.Parse(timeStamp + "0000000");
    //    TimeSpan toNow = new TimeSpan(lTime);
    //    DateTime dtResult = dtStart.Add(toNow);
    //    return dtResult;
    //}
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            switch (e.Row.Cells[1].Text.Trim())
            {
                case "PC":
                case "pc":
                    e.Row.Cells[1].Text = "桌面端";
                    break;
                case "APP":
                case "app":
                    e.Row.Cells[1].Text = "手机端";
                    break;
                case "WEB":
                case "web":
                    e.Row.Cells[1].Text = "网页端";
                    break;
            }
            // e.Row.Cells[4].Text = GetTime(e.Row.Cells[4].Text.Trim()).ToString();
        }
    }
}